package com.zss.dubbo.service.impl;

import java.util.Date;

import javax.annotation.Resource;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import com.zss.dubbo.dao.IBillRouteDao;
import com.zss.dubbo.entity.BillRoute;
import com.zss.dubbo.service.IScanService;

@Service("scanService")
public class ScanServiceImpl implements IScanService{
	private Logger logger = LoggerFactory.getLogger(ScanServiceImpl.class);
	@Resource
	private IBillRouteDao billRouteDao;
	@Transactional(readOnly=false,propagation=Propagation.REQUIRED)
	public void scan() {
		BillRoute billRoute = new BillRoute();
		billRoute.setBillCode("900122106533");
		billRoute.setBeginStationCode("UC008972");
		billRoute.setBeginStationName("上海分拨中心");
		billRoute.setEndStationCode("UC025765");
		billRoute.setEndStationName("UC025765");
		billRoute.setFullRouteCode("UC008972,UC025765,UC025763,UC027704");
		billRoute.setFullRouteName("上海分拨中心,南京分拨中心,无锡分拨中心,北京分拨中心");
		billRoute.setSendDate(new Date());
		billRoute.setDeleteFlag(false);
		billRoute.setScanFlag("scan_flag_bill_in");
		int id = billRouteDao.insertBillRouteWithDynamic(billRoute);
		logger.info("scan invoked!"+id+"=="+billRoute.getId());
	}

}
